import Vue from 'vue'
import ElementUI from 'element-ui'
import ECharts from 'vue-echarts'

if (process.env.NODE_ENV !== 'production') {
  import('normalize.css/normalize.css')
  import('element-ui/lib/theme-chalk/index.css')
  import('animate.css')
  import('echarts/lib/chart/bar')
  import('echarts/lib/chart/line')
  import('echarts/lib/chart/pie')
  import('echarts/lib/component/tooltip')
  import('echarts/lib/component/legend')
  import('echarts/lib/component/markPoint')
  import('echarts/lib/component/markLine')
  import('echarts/lib/component/graphic')
}

import '@/styles/index.scss' // global css
import '@/styles/font_ant/iconfont.css'
import App from './App.vue'
import store from '@/store'
import router from '@/router'
import { constantRouterMap } from '@/router'
import '@/icons' // icon
import '@/permission/permission' // permission control
import { parseTime } from '@/utils/common' // global filters
import * as filters from '@/filters' // global filters

Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})
Vue.filter('parseTime', parseTime)
Vue.use(ElementUI)
Vue.component('v-chart', ECharts)

// 将该系统的基本路由绑定到vue原型上
Vue.prototype.constantRouterMap = constantRouterMap
Vue.prototype.system = 'system1'
Vue.config.productionTip = false
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
